package com.itany.mapper;

import com.itany.pojo.Role;
import com.itany.pojo.RoleExample;

import java.util.List;

import org.apache.ibatis.annotations.Param;

public interface RoleMapper {
    long countByExample(RoleExample example);

    int deleteByExample(RoleExample example);

    int deleteByPrimaryKey(Integer id);

    // 返回 ID
    int insert(Role record);

    int insertSelective(Role record);

    List<Role> selectByExample(RoleExample example);

    Role selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByExample(@Param("record") Role record, @Param("example") RoleExample example);

    int updateByPrimaryKeySelective(Role record);

    int updateByPrimaryKey(Role record);

    int addRoleWithPermission(@Param("roleId") Integer roleId, @Param("permissionId") Integer permissionId);

    List<Role> findAllRoleWithPermissions(@Param("name")String name);

    int deleteRoleAndPermission(@Param("roleId") Integer roleId);

}